package s47.dqj.dao;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import s47.dqj.bean.MedicalDelete;

/**
 * 15.报废药品类型表
 * @author Administrator
 *
 */
@Repository("medicalDeleteTypeDaoImpl")
public class MedicalDeleteTypeDaoImpl extends HibernateDaoSupport implements MedicalDeleteTypeDaoInf{
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalDeleteTypeDaoInf#setSupperSessionFactory(org.hibernate.SessionFactory)
	 */
	@Override
	@Resource(name="sessionFactory")
	public void setSupperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalDeleteTypeDaoInf#findAll()
	 */
	@Override
	public List<MedicalDelete> findAll(){
		String hql="from MedicalDelete";
		return getHibernateTemplate().find(hql);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalDeleteTypeDaoInf#save(s47.dqj.bean.MedicalDelete)
	 */
	@Override
	public void save(MedicalDelete medicalDelete){
		getHibernateTemplate().save(medicalDelete);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalDeleteTypeDaoInf#update(s47.dqj.bean.MedicalDelete)
	 */
	@Override
	public void update(MedicalDelete medicalDelete){
		getHibernateTemplate().update(medicalDelete);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalDeleteTypeDaoInf#delete(s47.dqj.bean.MedicalDelete)
	 */
	@Override
	public void delete(MedicalDelete medicalDelete){
		getHibernateTemplate().delete(medicalDelete);
	}
}
